﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.XHRS
{
    class Class7
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            da.Value = ppa.PolicyActing.Policy.Fee * 0.06;


        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.Age == 60)
            {
                da.Value = ppa.Amount * 0.2;
            }


        }


        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.Age >= 60 && ppa.Age <= 88)
            {
                da.Value = ppa.Amount * 0.12;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                double s = ppa.GetDutyTotalValue("关爱年金") + ppa.GetDutyTotalValue("贺岁金") + ppa.GetDutyTotalValue("养老年金");

                da.Value = ppa.Amount - s;
                ppa.IsCurrentFinish = true;
            }
            
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0)
            {
                double f = (double)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("分红率(预估)");
                ppa.Amount = ppa.Amount * (1 + f);
            }

        }
    }
}
